<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>RabbitMQ 延迟消息插件完全指南</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            min-height: 100vh;
        }
        
        .hero-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            position: relative;
            overflow: hidden;
        }
        
        .hero-gradient::before {
            content: '';
            position: absolute;
            top: -50%;
            right: -50%;
            bottom: -50%;
            left: -50%;
            background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
            animation: float 20s linear infinite;
        }
        
        @keyframes float {
            0% { transform: translate(0, 0) rotate(0deg); }
            100% { transform: translate(-100px, -100px) rotate(360deg); }
        }
        
        .code-block {
            background: #1e1e1e;
            color: #d4d4d4;
            border-radius: 12px;
            position: relative;
            overflow: hidden;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        }
        
        .code-block::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 40px;
            background: #2d2d2d;
            border-bottom: 1px solid #3e3e3e;
        }
        
        .code-block pre {
            margin: 0;
            padding: 60px 30px 30px;
            overflow-x: auto;
        }
        
        .code-block code {
            font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
            line-height: 1.6;
        }
        
        .step-card {
            background: white;
            border-radius: 16px;
            padding: 30px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
        }
        
        .step-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 5px;
            height: 100%;
            background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
        }
        
        .step-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
        }
        
        .feature-icon {
            width: 60px;
            height: 60px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border-radius: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 24px;
            margin-bottom: 20px;
            box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
        }
        
        .section-title {
            position: relative;
            display: inline-block;
            margin-bottom: 40px;
        }
        
        .section-title::after {
            content: '';
            position: absolute;
            bottom: -10px;
            left: 0;
            width: 60px;
            height: 4px;
            background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
            border-radius: 2px;
        }
        
        .image-container {
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
            margin: 20px 0;
            transition: transform 0.3s ease;
        }
        
        .image-container:hover {
            transform: scale(1.02);
        }
        
        .mermaid {
            background: white;
            padding: 30px;
            border-radius: 12px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        }
        
        .highlight-box {
            background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
            color: white;
            padding: 20px 30px;
            border-radius: 12px;
            margin: 30px 0;
            position: relative;
            overflow: hidden;
        }
        
        .highlight-box::before {
            content: '';
            position: absolute;
            top: -50%;
            right: -50%;
            width: 200%;
            height: 200%;
            background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
            animation: pulse 3s ease-in-out infinite;
        }
        
        @keyframes pulse {
            0%, 100% { transform: scale(1); opacity: 0.5; }
            50% { transform: scale(1.1); opacity: 0.8; }
        }
    </style>
</head>
<body>
    <!-- Hero Section -->
    <div class="hero-gradient text-white py-20 px-8 relative">
        <div class="max-w-6xl mx-auto relative z-10">
            <div class="text-center">
                <h1 class="text-5xl md:text-6xl font-bold mb-6 tracking-tight">
                    RabbitMQ 延迟消息插件
                </h1>
                <p class="text-xl md:text-2xl opacity-90 mb-8 font-light">
                    突破传统 TTL 限制，实现精准的消息延迟投递
                </p>
                <div class="flex justify-center space-x-4">
                    <span class="bg-white bg-opacity-20 px-4 py-2 rounded-full text-sm">
                        <i class="fas fa-clock mr-2"></i>精准延迟
                    </span>
                    <span class="bg-white bg-opacity-20 px-4 py-2 rounded-full text-sm">
                        <i class="fas fa-rocket mr-2"></i>高性能
                    </span>
                    <span class="bg-white bg-opacity-20 px-4 py-2 rounded-full text-sm">
                        <i class="fas fa-shield-alt mr-2"></i>生产就绪
                    </span>
                </div>
            </div>
        </div>
    </div>

    <!-- Main Content -->
    <div class="max-w-6xl mx-auto px-8 py-16">
        <!-- 核心概念可视化 -->
        <section class="mb-20">
            <h2 class="section-title text-4xl font-bold text-gray-800">核心架构</h2>
            <div class="mermaid">
                graph LR
                    A[生产者] -->|发送延迟消息| B[延迟交换机<br/>x-delayed-message]
                    B -->|存储消息<br/>直到延迟时间到达| B
                    B -->|延迟时间到达| C[路由到队列]
                    C --> D[延迟队列]
                    D --> E[消费者]
                    
                    style A fill:#667eea,stroke:#fff,stroke-width:2px,color:#fff
                    style B fill:#764ba2,stroke:#fff,stroke-width:2px,color:#fff
                    style C fill:#f093fb,stroke:#fff,stroke-width:2px,color:#fff
                    style D fill:#f5576c,stroke:#fff,stroke-width:2px,color:#fff
                    style E fill:#4facfe,stroke:#fff,stroke-width:2px,color:#fff
            </div>
        </section>

        <!-- 安装步骤 -->
        <section class="mb-20">
            <h2 class="section-title text-4xl font-bold text-gray-800">安装配置</h2>
            
            <div class="grid md:grid-cols-2 gap-8">
                <!-- Step 1 -->
                <div class="step-card">
                    <div class="feature-icon">
                        <i class="fas fa-download"></i>
                    </div>
                    <h3 class="text-2xl font-bold mb-4 text-gray-800">步骤 1：下载插件</h3>
                    <p class="text-gray-600 mb-4">
                        访问 GitHub 仓库下载与您的 RabbitMQ 版本匹配的插件
                    </p>
                    <a href="https://github.com/rabbitmq/rabbitmq-delayed-message-exchange/releases" 
                       target="_blank" 
                       class="inline-flex items-center text-purple-600 hover:text-purple-700 font-medium">
                        <i class="fas fa-external-link-alt mr-2"></i>
                        前往下载页面
                    </a>
                    <div class="image-container mt-4">
                        <img src="https://cdn.nlark.com/yuque/0/2022/png/21449790/1670050840320-6cae05e3-431b-4c85-83dd-d090ba509b2a.png" 
                             alt="插件版本选择" class="w-full">
                    </div>
                </div>

                <!-- Step 2 -->
                <div class="step-card">
                    <div class="feature-icon">
                        <i class="fas fa-file-import"></i>
                    </div>
                    <h3 class="text-2xl font-bold mb-4 text-gray-800">步骤 2：拷贝到容器</h3>
                    <p class="text-gray-600 mb-4">
                        将下载的插件文件拷贝到 RabbitMQ 容器的 plugins 目录
                    </p>
                    <div class="code-block">
                        <pre><code>docker cp rabbitmq_delayed_message_exchange-3.8.17.8f537ac.ez rabbitmq:/plugins</code></pre>
                    </div>
                </div>

                <!-- Step 3 -->
                <div class="step-card">
                    <div class="feature-icon">
                        <i class="fas fa-terminal"></i>
                    </div>
                    <h3 class="text-2xl font-bold mb-4 text-gray-800">步骤 3：进入容器</h3>
                    <p class="text-gray-600 mb-4">
                        进入 RabbitMQ 容器并查看插件列表
                    </p>
                    <div class="image-container">
                        <img src="https://cdn.nlark.com/yuque/0/2022/png/21449790/1670051150014-5581d748-124a-4926-8a80-737746f03eac.png" 
                             alt="查看插件" class="w-full">
                    </div>
                </div>

                <!-- Step 4 -->
                <div class="step-card">
                    <div class="feature-icon">
                        <i class="fas fa-plug"></i>
                    </div>
                    <h3 class="text-2xl font-bold mb-4 text-gray-800">步骤 4：启用插件</h3>
                    <p class="text-gray-600 mb-4">
                        执行命令启用延迟消息插件
                    </p>
                    <div class="code-block">
                        <pre><code>rabbitmq-plugins enable rabbitmq_delayed_message_exchange</code></pre>
                    </div>
                    <div class="image-container mt-4">
                        <img src="https://cdn.nlark.com/yuque/0/2022/png/21449790/1670051212002-bc145046-1d83-4969-9af7-4c0856237276.png" 
                             alt="启用插件" class="w-full">
                    </div>
                </div>
            </div>

            <!-- 验证安装 -->
            <div class="highlight-box mt-8">
                <h4 class="text-xl font-bold mb-2 flex items-center">
                    <i class="fas fa-check-circle mr-3"></i>
                    验证安装成功
                </h4>
                <p class="opacity-90">
                    在 RabbitMQ 管理界面中，创建交换机时应该能看到 "x-delayed-message" 类型选项
                </p>
                <div class="image-container mt-4">
                    <img src="https://cdn.nlark.com/yuque/0/2022/png/21449790/1670051301226-aaed0e69-7fb8-42b9-812d-2ca7d2cb6c62.png" 
                         alt="验证安装" class="w-full">
                </div>
            </div>